﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Pi_Input.aspx.cs" Inherits="Dynamic.Testing.Web.WebForm1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <script language="javascript" type="text/javascript" src="/Javascript/calendar/WdatePicker.js"></script>

    <script language="javascript" type="text/javascript" src="/Javascript/jQuery/jquery-1.3.2.min.js"></script>

    <script type='text/javascript' src='../Javascript/jQuery/jquery.bgiframe.min.js'></script>

    <script type='text/javascript' src='../Javascript/jQuery/jquery.ajaxQueue.js'></script>

    <script type='text/javascript' src='../Javascript/jQuery/thickbox-compressed.js'></script>

    <script type='text/javascript' src='../Javascript/jQuery/jquery.autocomplete.min.js'></script>

    <script type='text/javascript' src='../Javascript/jQuery/localdata.js'></script>

    <link rel="stylesheet" type="text/css" href="../Javascript/jQuery/jquery.autocomplete.css" />
    <link rel="stylesheet" type="text/css" href="../Javascript/jQuery/thickbox.css" />
    <link href="../Javascript/calendar/skin/WdatePicker.css" rel="stylesheet" type="text/css" />
    <!-- TemplateBeginEditable name="doctitle" -->
    <title>pi_show</title>
    <!-- TemplateEndEditable -->
    <!-- TemplateBeginEditable name="head" -->
    <!-- TemplateEndEditable -->
    <style type="text/css">
        body
        {
            font: 100% 宋体, 新宋体;
            background: #FFF;
            margin: 0; /* 最好将 body 元素的边距和填充设置为 0 以覆盖不同的浏览器默认值 */
            padding: 0;
            margin: 0px auto;
            text-align: center; /* 在 IE 5* 浏览器中，这会将容器居中。文本随后将在 #container 选择器中设置为默认左对齐 */
            color: #000000;
            background-color: #FFF;
        }
        .thrColFixHdr #container
        {
            width: 780px; /* 使用比最大宽度 (800px) 小 20px 的宽度可显示浏览器界面元素，并避免出现水平滚动条 */
            background: #FFFFFF;
            margin: 0 auto; /* 自动边距（与宽度一起）会将页面居中 */
            border: 0px solid #000000;
            text-align: left; /* 这将覆盖 body 元素上的“text-align: center”。 */
        }
        .thrColFixHdr #header
        {
            padding: 0 10px 0 20px; /* 此填充会将出现在它后面的 div 中的元素左对齐。如果 #header 中使用的是图像（而不是文本），您最好删除填充。 */
            background-color: #FFF;
            color: #000;
        }
        .thrColFixHdr #header h1
        {
            margin: 0; /* 将 #header div 中最后一个元素的边距设置为零将避免边距重叠（即 div 之间出现的无法解释的空白）。如果 div 周围有边框，则不必将边距设置为零，因为边框也会避免边距重叠 */
            padding: 10px 0; /* 使用填充而不使用边距将可以使元素远离 div 的边缘 */
            background-color: #FFF;
            color: #000;
        }
        .thrColFixHdr #sidebar1
        {
            float: left; /* 由于此元素是浮动的，因此必须指定宽度 */
            width: 150px; /* 在符合标准的浏览器中或者在 Internet Explorer 中的标准模式下，此 div 的实际宽度除了包括宽度外，还包括填充和边框 */
            background: #EBEBEB; /* 将显示背景色，其宽度等于栏中内容的长度，*/
            padding: 15px 10px 15px 20px; /* 填充使 div 的内容与边缘保持一定的距离 */
        }
        .thrColFixHdr #sidebar2
        {
            float: right; /* 由于此元素是浮动的，因此必须指定宽度 */
            width: 160px; /* 在符合标准的浏览器中或者在 Internet Explorer 中的标准模式下，此 div 的实际宽度除了包括宽度外，还包括填充和边框 */
            background: #EBEBEB; /* 将显示背景色，其宽度等于栏中内容的长度，*/
            padding: 15px 10px 15px 20px; /* 填充使 div 的内容与边缘保持一定的距离 */
        }
        .thrColFixHdr #mainContent
        {
            margin: 0 200px; /* 此 div 元素的左边距和右边距会在页面两侧上创建两个外部栏。无论侧栏 div 中包含多少内容，栏内的空间都将保留。如果您希望在每个侧栏中的内容结束时，用 #mainContent div 的文本填充侧栏内的空白，可以删除此边距。 */
            padding: 0 10px; /* 请记住，填充是 div 方块内部的空间，边距则是 div 方块外部的空间 */
        }
        .thrColFixHdr #footer
        {
            padding: 0 10px 0 20px; /* 此填充会将它上面 div 中的所有元素左对齐。 */
            background: #DDDDDD;
        }
        .thrColFixHdr #footer p
        {
            margin: 0; /* 将脚注中第一个元素的边距设置为零将避免出现可能的边距重叠（即 div 之间出现的空白）*/
            padding: 10px 0; /* 就像边距会产生空白一样，此元素上的填充也将产生空白，但不会出现边距重叠问题 */
        }
        .fltrt
        {
            /* 此类可用来使页面中的元素向右浮动。浮动元素必须位于页面上要与之相邻的元素之前。 */
            float: right;
            margin-left: 8px;
        }
        .fltlft
        {
            /* 此类可用来使页面上的元素向左浮动 */
            float: left;
            margin-right: 8px;
        }
        .clearfloat
        {
            /* 此类应当放在 div 或 break 元素上，而且该元素应当是完全包含浮动的容器关闭之前的最后一个元素 */
            clear: both;
            height: 0;
            font-size: 1px;
            line-height: 0px;
        }
        .Arial
        {
            font-family: Arial, Helvetica, sans-serif;
            font-size: 24px;
        }
        .arial_14
        {
            font-family: Arial, Helvetica, sans-serif;
            font-size: 14px;
        }
        .arial_18
        {
            font-family: Arial, Helvetica, sans-serif;
            font-size: 18px;
        }
        .arial_14_barck
        {
            font-family: Arial, Helvetica, sans-serif;
            font-size: 14px;
            background-color: #FFF;
            font-weight: normal;
            text-transform: capitalize;
            font-style: normal;
        }
        .white
        {
            font-family: Arial, Helvetica, sans-serif;
            font-size: 24px;
            color: #FFF;
        }
        .TimesNewRoman
        {
            font-family: "Times New Roman" , Times, serif;
            font-size: 16px;
            color: #000;
        }
        .divstyle
        {
            margin-left: auto;
            margin-right: auto;
        }
        #testest{
border:0;
overflow:auto;
width:80%;
font-weight:bolder;
font-size:16px;
}
        </style>

    <script language="javascript" type="text/javascript">        // Example: obj = findObj("image1");
        function findObj(theObj, theDoc) {
            var p, i, foundObj;
            if (!theDoc) theDoc = document;
            if ((p = theObj.indexOf("?")) > 0 && parent.frames.length)
            { theDoc = parent.frames[theObj.substring(p + 1)].document; theObj = theObj.substring(0, p); } if (!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj]; for (i = 0; !foundObj && i < theDoc.forms.length; i++) foundObj = theDoc.forms[i][theObj]; for (i = 0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) foundObj = findObj(theObj, theDoc.layers[i].document); if (!foundObj && document.getElementById) foundObj = document.getElementById(theObj); return foundObj;
        }
        //添加一个填写行
        function AddSignRow(json) { //读取最后一行的行号，存放在txtTRLastIndex文本框中 
            var txtTRLastIndex = findObj("txtTRLastIndex", document);
            var rowID = parseInt(txtTRLastIndex.value);

            var signFrame = findObj("SignFrame", document);
            //添加行
            var newTR = signFrame.insertRow(signFrame.rows.length);
            newTR.id = "SignItem" + rowID;

            //添加列:序号
            var newNameTD = newTR.insertCell(0);
            //添加列内容
            newNameTD.innerHTML = newTR.rowIndex.toString();

            //添加列:编号
            var newNameTD = newTR.insertCell(1);
            //添加列内容

            //            newNameTD.innerHTML = "<select name='txtItemNo" + rowID + "' id='txtItemNo" + rowID + "' onchange='txtItemNoChanged(this," + rowID + ")' >"
            //                            + str
            //                            + "</select>";onfocusout='txtItemNoChanged(this,'" + rowID + "')'

            newNameTD.innerHTML = "<input name='txtItemNo" + rowID + "' id='txtItemNo" + rowID + "' type='text' size='20'  />";

            $("#txtItemNo" + rowID).focus().autocomplete(json, {
                width: 140,
                scrollHeight: 300,
                selectFirst: false
            }).result(function() {
                txtItemNoChanged(rowID);
            });

            //添加列:描述
            var newEmailTD = newTR.insertCell(2);
            //添加列内容
            newEmailTD.innerHTML = "<input name='txtDesc" + rowID + "' id='txtDesc" + rowID + "' type='text'/>";

            //添加列:数量
            var newTelTD = newTR.insertCell(3);
            //添加列内容
            newTelTD.innerHTML = "<input name='txtQuantity" + rowID + "' id='txtQuantity" + rowID + "' type='text' size='10' onfocusout='CalAmount(this," + rowID + ")'/>";

            //添加列:单价
            var newMobileTD = newTR.insertCell(4);
            //添加列内容
            newMobileTD.innerHTML = "<input name='txtPrice" + rowID + "' id='txtPrice" + rowID + "' type='text' size='12' disabled='disabled' />";

            //添加列:小计
            var newCompanyTD = newTR.insertCell(5);
            //添加列内容
            newCompanyTD.innerHTML = "<input name='txtAmount" + rowID + "' id='txtAmount" + rowID + "' type='text' size='12' disabled='disabled'/>";

            //添加列:Date
            var newCompanyTD = newTR.insertCell(6);
            //添加列内容
            newCompanyTD.innerHTML = "<input name='txtDate" + rowID + "' id='txtDate" + rowID + "' type='text' size='12' onFocus=WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'}) />";

            //添加列:删除按钮
            var newDeleteTD = newTR.insertCell(7);
            //添加列内容
            newDeleteTD.innerHTML = "<div align='center' style='width:40px'><a href='javascript:;' onclick=\"DeleteSignRow('SignItem" + rowID + "')\">删除</a></div>";

            //将行号推进下一行
            txtTRLastIndex.value = (rowID + 1).toString();
        }
        //删除指定行
        function DeleteSignRow(rowid) {
            var signFrame = findObj("SignFrame", document);
            var signItem = findObj(rowid, document);

            //获取将要删除的行的Index
            var rowIndex = signItem.rowIndex;

            //删除指定Index的行
            signFrame.deleteRow(rowIndex);

            //重新排列序号，如果没有序号，这一步省略
            for (i = rowIndex; i < signFrame.rows.length; i++) {
                signFrame.rows[i].cells[0].innerHTML = i.toString();
            }
        } //清空列表
        function ClearAllSign() {
            if (confirm('确定要清空所有产品吗？')) {
                var signFrame = findObj("SignFrame", document);
                var rowscount = signFrame.rows.length;

                //循环删除行,从最后一行往前删除
                for (i = rowscount - 1; i > 0; i--) {
                    signFrame.deleteRow(i);
                }

                //重置最后行号为1
                var txtTRLastIndex = findObj("txtTRLastIndex", document);
                txtTRLastIndex.value = "1";

                //预添加一行
                //AddSignRow();
            }
        }

        function PostData() {
            var sql = "";
            var rows = document.getElementById("SignFrame").rows;
            var txtPO_NO = document.getElementById("txtPO_NO").value;
            var txtClinet_PO = document.getElementById("txtClinet_PO").value;
            var txtPIINfo = document.getElementById("txtPIINfo").value;
            var txtDate = document.getElementById("txtDate").value;
            var addr = document.getElementById("addr").value; //escape(document.getElementById("addr").value.replace(/\r\n/ig, "<br/>"));
            var Attn = document.getElementById("Attn").value;
            var total1 = document.getElementById("total1").value;
            var total2 = document.getElementById("total2").value;
            var delAddr = document.getElementById("delAddr").value;

            sql += "begin transaction \r\ngo\r\ninsert into [a01](po_no,client_po,invoice_number,agreement_date,customer,SAO_attn,delivery_Address) ";
            sql += "values('" + txtPO_NO + "','" + txtClinet_PO + "','" + txtPIINfo + "','" + txtDate + "','" + addr + "','" + Attn + "','" + delAddr + "'); \r\n";
            for (var i = 1; i < rows.length; i++) {
                var pos = rows[i].cells[0].innerText;
                var c_txtItemNo = document.getElementById("txtItemNo" + pos).value; //.options[window.document.getElementById("txtItemNo" + pos).selectedIndex].text;
                var itemNo = c_txtItemNo.split("(")[0];
                var cmmf = c_txtItemNo.split("(")[1].split(")")[0];
                var c_txtDesc = document.getElementById("txtDesc" + pos).value;
                var c_txtQuantity = document.getElementById("txtQuantity" + pos).value;
                var c_txtPrice = document.getElementById("txtPrice" + pos).value;
                var c_txtAmount = document.getElementById("txtAmount" + pos).value;
                var c_txtDate = document.getElementById("txtDate" + pos).value;
                sql += "insert into [a02] (po_no,invoice_number,item_no,cmmf_code,description,quantity,uprice,amount,ship_date) ";
                sql += "values('" + txtPO_NO + "','" + txtPIINfo + "','" + itemNo + "','" + cmmf + "','" + c_txtDesc + "','" + c_txtQuantity + "'," + c_txtPrice + "," + c_txtAmount + ",'" + c_txtDate + "');\r\n";

            }
            sql += "commit transaction\r\n";

            $.post("DoSave.aspx", { Action: "post", data: sql },
		function(info, textStatus) {
		    // data 可以是 xmlDoc, jsonObj, html, text, 等等.
		    //this; // 这个Ajax请求的选项配置信息，请参考jQuery.get()说到的this
		    alert(info); window.location.href = "index.asp?d=" + Math.random();
		}, "text");
            return true;
        }

        function txtItemNoChanged(rowid) {
            //ajax
            var idd = document.getElementById("txtItemNo" + rowid).value;
            $.ajax({
                url: 'GetProduct.aspx?id=' + idd,
                type: 'GET',
                dataType: 'JSON',
                timeout: 5000,
                error: function() {
                    alert('Error loading');
                },
                success: function(json) {
                    // do something with xml
                    //debugger;
                    var reult = eval('(' + json + ')');
                    //document.getElementById("txtItemNo" + rowid).value = c_txtItemNo;
                    document.getElementById("txtDesc" + rowid).value = reult.c_txtDesc;
                    document.getElementById("txtPrice" + rowid).value = reult.c_txtPrice;
                    //document.getElementById("txtAmount" + rowid).value = reult.c_txtAmount;
                    //document.getElementById("txtDate" + rowid).value = reult.c_txtDate;
                }
            });

        }

        function CalAmount(obj, rowid) {
            document.getElementById("txtAmount" + rowid).value = document.getElementById("txtPrice" + rowid).value * document.getElementById("txtQuantity" + rowid).value;
            var t1 = 0;
            var t2 = 0;
            for (var i = 1; i < findObj("txtTRLastIndex", document).value; i++) {
                t1 += document.getElementById("txtQuantity" + i).value * 1;
                t2 += document.getElementById("txtAmount" + i).value * 1;
            }
            findObj("total1", document).value = t1;
            findObj("total2", document).value = t2;
        }

        function loadRow() {
            $.ajax({
                url: 'GetProductList.aspx',
                type: 'GET',
                dataType: 'json',
                timeout: 5000,
                error: function() {
                    alert('Error loading');
                },
                success: function(json) {
                    // do something with xml
                    AddSignRow(json);
                }
            });
        }

        function loadPINum() {
            var ran = "d=" + Math.random();
            $.ajax({
                url: 'GetInfo.aspx?t=1&' + ran,
                type: 'GET',
                dataType: 'Text',
                timeout: 5000,
                error: function() {
                    alert('Error loading');
                },
                success: function(json) {
                    // do something with xml
                    document.getElementById("txtPIINfo").value = json;
                }
            });
        }
        function loadCustom() {

            $.ajax({
                url: 'GetInfo.aspx?t=2',
                type: 'GET',
                dataType: 'Text',
                timeout: 5000,
                error: function() {
                    alert('Error loading');
                },
                success: function(json) {
                    // do something with xml
                    var cust = findObj("customer", document);
                    addOption(cust, "请选择...", "请选择...");
                    var ss = json.split(",");
                    for (var key in ss) {
                        addOption(cust, ss[key], ss[key]);
                    }
                }
            });
        }

        function loadCustomContent() {
            var cust = document.getElementById("customer").options[window.document.getElementById("customer").selectedIndex].text;
            $.ajax({
                url: 'GetInfo.aspx?t=3&co=' + cust,
                type: 'GET',
                dataType: 'Text',
                timeout: 5000,
                error: function() {
                    alert('Error loading');
                },
                success: function(json) {
                    // do something with xml
                    var addr = findObj("addr", document);
                    addr.value = json;
                }
            });
        }

        function loadAttn() {
            $.ajax({
                url: 'GetInfo.aspx?t=5',
                type: 'GET',
                dataType: 'Text',
                timeout: 5000,
                error: function() {
                    alert('Error loading');
                },
                success: function(json) {
                    // do something with xml

                    var cust = findObj("Attn", document);
                    var ss = json.split(",");
                    addOption(cust, "请选择...", "请选择...");
                    for (var key in ss) {
                        addOption(cust, ss[key], ss[key]);
                    }
                }
            });
        }

        function loadCustomDelAddr() {
            var cust = document.getElementById("sltDelAddr").options[window.document.getElementById("sltDelAddr").selectedIndex].text;
            $.ajax({
                url: 'GetInfo.aspx?t=6&id=' + cust,
                type: 'GET',
                dataType: 'Text',
                timeout: 5000,
                error: function() {
                    alert('Error loading');
                },
                success: function(json) {
                    // do something with xml
                    var addr = findObj("delAddr", document);
                    addr.value = json;
                }
            });
        }

        function loadCustomDelAddrs() {
            $.ajax({
                url: 'GetInfo.aspx?t=4',
                type: 'GET',
                dataType: 'Text',
                timeout: 5000,
                error: function() {
                    alert('Error loading');
                },
                success: function(json) {
                    // do something with xml
                    var sltDelAddr = findObj("sltDelAddr", document);
                    var ss = json.split(",");
                    addOption(sltDelAddr, "请选择...", "请选择...");
                    for (var key in ss) {
                        addOption(sltDelAddr, ss[key], ss[key]);
                    }
                }
            });
        }
        function addOption(objSelectNow, txt, val) {
            // / 使用W3C标准语法为SELECT添加Option  
            var objOption = document.createElement("OPTION");
            objOption.text = txt;
            objOption.value = val;
            objSelectNow.options.add(objOption);
        }

        function load() {
            loadPINum();
            loadCustom();
            loadAttn();
            loadCustomDelAddrs();
        }
        //onload="loadInfo();" onsubmit="return PostData()"
    </script>

    <!--[if IE 5]>
<style type="text/css"> 
/* 将 IE 5* 的 css 方块模型修正放在这个条件注释中 */
.thrColFixHdr #sidebar1 { width: 180px; }
.thrColFixHdr #sidebar2 { width: 190px; }
</style>
<![endif]-->
    <!--[if IE]>
<style type="text/css"> 
/* 请将所有版本的 IE 的 css 修复放在这个条件注释中 */
.thrColFixHdr #sidebar2, .thrColFixHdr #sidebar1 { padding-top: 30px; }
.thrColFixHdr #mainContent { zoom: 1; }
/* 上面的专用 zoom 属性为 IE 提供避免错误所需的 hasLayout */
    #taAttr
    {
        height: 80px;
        width: 503px;
    }
    #addr
    {
        width: 497px;
        height: 143px;
    }
    #delAddr
    {
        width: 530px;
    }
    #total2
    {
        width: 100px;
    }
    #total1
    {
        width: 90px;
    }
    .style1
    {
        font-family: "Times New Roman" , Times, serif;
        font-size: 16px;
        color: #000;
        width: 690px;
    }
    .style2
    {
        width: 160px;
    }
</style>
<![endif]-->
</head>
<body class="thrColFixHdr">
    <table width="200" border="0" align="center">
        <tr>
            <td>
                <form name="form1">
                <div id="header">
                    <h1 align="left">
                        <img src="/pic/log.jpg" alt="log" width="115" height="26" /></h1>
                    <h1 align="center" class="Arial">
                        <span class="Arial">Zhejiang Supor Co.Ltd.</span></h1>
                    <p align="center" class="arial_14">
                        Damaiyu Economic Investment Zone,Yuhuan,Zhejiang, China 317604</p>
                    <p align="center" class="arial_14">
                        Tel:86-576-87331913 Fax:86-576-87333926</p>
                    <!-- end #header -->
                </div>
                <p>
                    <!-- 这个用于清除浮动的元素应当紧跟 #mainContent div 之后，以便强制 #container div 包含所有的子浮动 -->
                </p>
                <div class="divstyle">
                    <table cellspacing="0" cellpadding="0">
                        <tr>
                            <td colspan="10">
                                <p>
                                    ------------------------------------------------------------------------------------------------</p>
                            </td>
                        </tr>
                    </table>
                    <table width="768" cellpadding="0" cellspacing="0">
                        <col width="136" />
                        <col width="141" />
                        <col width="68" />
                        <col width="72" />
                        <col width="37" />
                        <col width="73" />
                        <col width="58" />
                        <col width="59" />
                        <col width="124" />
                        <col width="53" />
                        <col width="116" />
                        <col width="142" />
                        <tr>
                            <td class="style2">
                                <span class="arial_14"><strong>P/O NO.:</strong></span>
                            </td>
                            <td width="144" class="arial_14">
                                <input type="text" id="txtPO_NO" name="txtPO_NO" />
                            </td>
                            <td width="41">
                            </td>
                            <td colspan="5" rowspan="2" nowrap="nowrap" class="arial_14">
                                <strong class="arial_18">Proforma Invoice</strong>
                            </td>
                            <td colspan="4" rowspan="2" width="265" align="left">
                                <span class="arial_14"><strong>
                                    <input type="text" id="txtPIINfo" name="txtPIINfo" disabled="disabled" /></strong>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="style2">
                                <strong><span class="arial_14">Client P/O:</span></strong>
                            </td>
                            <td class="arial_14">
                                <input type="text" id="txtClinet_PO" name="txtClinet_PO" />
                            </td>
                        </tr>
                        </talbe>
                        <table cellpadding="0" cellspacing="0">
                            <tr>
                                <td colspan="10">
                                    <p>
                                        ------------------------------------------------------------------------------------------------</p>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="10">
                                    <strong class="arial_14">AGREEMENT</strong> <span class="arial_14">made on<input
                                        type="text" id="txtDate" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})" />
                                        &nbsp;<u><strong></strong></u>between <strong>Zhejiang Supor Co. Ltd.</strong>,
                                        the Seller, and</span>
                                </td>
                            </tr>
                            <tr>
                                <td class="style2">
                                    &nbsp;
                                </td>
                                <td width="671" colspan="9" align="left">
                                    <p class="arial_14">
                                        <strong>Custom:<select id="customer" name="customer" onchange="loadCustomContent()">
                                        </select></strong>
                                        <br />
                                        <textarea id="addr" name="addr" disabled="disabled" rows="5"></textarea>
                                    </p>
                                    <p class="arial_14">
                                        <strong>Attn:
                                            <select id="Attn" name="Attn">
                                            </select>
                                        </strong>
                                    </p>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="10">
                                    <p class="arial_14">
                                        the buyer, whereby the Seller agrees to sell and the Buyer agrees to buy the goods
                                        specified herein subject to the terms and conditions stated below:</p>
                                </td>
                            </tr>
                        </table>
                        <table border="1" cellpadding="1" cellspacing="0" id="SignFrame">
                            <tr class="arial_14_barck">
                                <td>
                                    No
                                </td>
                                <td width="178">
                                    <p align="center">
                                        <strong>Item No(CMMF Code)</strong></p>
                                </td>
                                <td width="171">
                                    <div align="center">
                                        <strong>Description</strong></div>
                                </td>
                                <td width="90">
                                    <div align="center">
                                        <strong>Quantity</strong></div>
                                </td>
                                <td width="95">
                                    <div align="center">
                                        <strong>UPrice</strong></div>
                                </td>
                                <td width="100">
                                    <div align="center">
                                        <strong>Amount</strong></div>
                                </td>
                                <td width="60">
                                    <div align="center">
                                        <strong>Ship_date</strong></div>
                                </td>
                                <td width="57" align="center">
                                    <strong>Delete</strong>
                                </td>
                            </tr>
                        </table>
                        <table border="0" cellpadding="0" cellspacing="0" id="totaltable" width="768">
                            <tr>
                                <td width="280" align="center">
                                    <strong><span class="arial_14">FOB NINGBO,CHINA</span></strong>
                                </td>
                                <td width="90">
                                    <input type="text" id="total1" disabled="disabled" style="border-style: none;" />
                                </td>
                                <td width="230" align="right">
                                    <strong><span class="arial_14">TOTAL</span></strong><input type="text" id="total2"
                                        disabled="disabled" style="border-style: none" />
                                </td>
                                <td width="50">
                                </td>
                            </tr>
                        </table>
                        <table width="768">
                            <tr align="left">
                                <td>
                                    <input type="button" name="Submit" value="AddProduct" onclick="loadRow()" />
                                    <input type="button" name="Submit2" value="Clear" onclick="ClearAllSign()" />
                                    <input name='txtTRLastIndex' type='hidden' id='txtTRLastIndex' value="1" />
                                </td>
                                <td>
                                </td>
                            </tr>
                        </table>
                        <table border="1" cellpadding="1" cellspacing="0">
                            <col />
                            <col width="141" />
                            <col width="68" />
                            <col width="72" />
                            <col width="37" />
                            <col width="73" />
                            <col width="58" />
                            <col width="59" />
                            <col width="124" />
                            <col width="53" />
                            <col width="116" />
                            <tr>
                                <td width="136" class="arial_14_barck">
                                    Insurance
                                </td>
                                <td colspan="10" class="style1">
                                    <div align="left">
                                        Freight insurance is covered by the buyer.
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td width="136" class="arial_14_barck">
                                    Shipment Date
                                </td>
                                <td colspan="10" class="style1">
                                    <div align="left">
                                        See Above If the vessel delayed, the ETD will be delayed accordingly.
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td width="136" class="arial_14_barck">
                                    Delivery Address:
                                </td>
                                <td colspan="10" class="style1">
                                    <div align="left">
                                        <select id="sltDelAddr" name="sltDelAddr" onchange="loadCustomDelAddr()">
                                        </select>
                                        <input type="text" id="delAddr" name="delAddr" disabled="disabled" />
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td width="136" class="arial_14_barck">
                                    Payment
                                </td>
                                <td colspan="10" class="style1">
                                    <div align="left">
                                        Within 60days based on receipt of shipping documents.
                                    </div>
                                </td>
                            </tr>
                        </table>
                        <table cellspacing="0" cellpadding="0">
                            <tr>
                                <td width="130" class="arial_18">
                                    The Seller:
                                </td>
                                <td width="132">
                                </td>
                                <td width="64">
                                </td>
                                <td width="67">
                                </td>
                                <td width="34">
                                </td>
                                <td width="68">
                                </td>
                                <td colspan="2" class="arial_18">
                                    The buyer
                                </td>
                                <td width="84">
                                    :
                                </td>
                                <td width="89">
                                </td>
                            </tr>
                        </table>
                        <p>
                            &nbsp;
                        </p>
                        <p align="left">
                            <img src="/pic/sxz.jpg" alt="sxz" width="600" height="198" align="middle" /></p>
                        <p>
                            &nbsp;
                        </p>
                        <p>
                            <br class="clearfloat" />
                        </p>
                        <p>
                            <!-- end #container -->
                            <input type="button" name="Submit2" value="提交" onclick="PostData()" />
                        </p>
                        <p>
                            &nbsp;</p>
                </form>
                </p>
            </td>
        </tr>
    </table>
    <textarea id="testest" rows="1" >asdfadsfasdddddddddddddddddddddddddddddddddddddddf;aslkoasjfoewonvlzvnlfjasofasafsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssdndfladsifowenasldfawoefnaslfowfnasldfiwofnsfwofnsofwofn</textarea>
</body>
</html>

<script language="javascript" type="text/javascript">
    load();
    function aaa(selector, maxRow) {
        maxRow = maxRow || 30;
        jQuery(selector).each(function() {
            while (this.scrollHeight > this.clientHeight && this.rows < maxRow) {
                this.rows += 1;
            }
        });
    }
    aaa("#testest",30);
</script>

